@import "./variables";
@import "./libs/normalize";

@import "./components/all";

.App {
  display: flex;
  min-height: 100vh;
}

body {
  background-color: $background;
}

.wrapper {
  width: calc(100vw - 100px);
  background-color: #fff;
  margin: 50px auto;
  border-radius: 10px;
  max-width: 1400px;
  @media (max-width: 800px) {
    margin: 20px auto;
    width: calc(100vw - 40px);
  }
  @media (max-width: 600px) {
    margin: 0 auto;
    width: 100%;
  }
}

.content {
  padding: 40px 0;

  &__title {
    margin: 35px 0;
    @media (max-width: 850px) {
      margin: 0;
    }
  }

  &__items {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
  }

  &__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
  }
}

.container {
  width: $container-width;
  margin: 0 auto;

  &--cart {
    max-width: 820px;
    margin: 90px auto;
    .content__title {
      margin: 0;
    }
  }
}

.cart {
  &__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .content__title {
    display: flex;
    align-items: center;
    font-size: 32px;

    svg {
      @media (max-width: 450px) {
        display: none;
      }

      position: relative;
      top: -2px;
      width: 30px;
      height: 30px;
      margin-right: 10px;
      path {
        stroke: $black;
        stroke-width: 1.9;
      }
    }
  }

  &__clear {
    display: flex;
    align-items: center;
    cursor: pointer;
    @include noselect();

    span {
      @media (max-width: 450px) {
        font-size: 15px;
      }
      display: inline-block;
      margin-left: 7px;
      color: #b6b6b6;
      font-size: 18px;
    }

    span,
    svg,
    path {
      transition: all $duration ease-in-out;
    }

    &:hover {
      svg {
        path {
          stroke: darken($color: #b6b6b6, $amount: 50);
        }
      }
      span {
        color: darken($color: #b6b6b6, $amount: 50);
      }
    }
  }

  &__item {
    display: flex;
    width: 100%;
    border-top: 1px solid $gray-line;
    padding-top: 30px;
    margin-top: 30px;
    &__left {
      width: 50%;
      display: flex;
      @media (max-width: 850px) {
        width: 43%;
        display: flex;
        flex-direction: column;
      }
      @media (max-width: 480px) {
        width: 34%;
      }
    }
    &-img {
      display: flex;
      align-items: center;
      margin-right: 15px;
      width: 20%;

      img {
        width: 80px;
        height: 80px;
      }
    }

    &-info {
      display: flex;
      flex-direction: column;
      justify-content: center;
      width: 80%;

      h3 {
        font-weight: bold;
        font-size: 22px;
        @media (max-width: 480px) {
          font-size: 18px;
        }
        line-height: 27px;
        letter-spacing: 0.01em;
      }

      p {
        font-size: 18px;
        @media (max-width: 480px) {
          font-size: 14px;
        }
        color: #8d8d8d;
      }
    }

    &-count {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 13%;
      @media (max-width: 850px) {
        width: 20%;
      }

      @media (max-width: 480px) {
        width: 30%;
      }

      &-minus {
        svg {
          path:first-of-type {
            display: none;
          }
        }
      }

      b {
        @media (max-width: 550px) {
          font-size: 20px;
        }
        font-size: 22px;
      }
    }

    &-price {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 33%;

      @media (max-width: 550px) {
        width: 28%;
        font-size: 20px;
      }

      b {
        @media (max-width: 550px) {
          font-size: 18px;
        }
        font-weight: bold;
        font-size: 22px;
        letter-spacing: 0.01em;
      }
    }

    &-remove {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      width: 4%;
      @media (max-width: 550px) {
        width: 8%;
      }
      .button {
        border-color: darken($color: $gray-line, $amount: 10);
      }

      svg {
        transform: rotate(45deg);

        path {
          fill: darken($color: $gray-line, $amount: 15);
        }
      }

      .button {
        svg {
          width: 11.5px;
          height: 11.5px;
          position: relative;
        }
        &:hover,
        &:active {
          border-color: darken($color: $gray-line, $amount: 80);
          background-color: darken($color: $gray-line, $amount: 80);
        }
      }
    }
  }

  &__bottom {
    margin: 50px 0;

    &-details {
      display: flex;
      justify-content: space-between;
      &__one {
        @media (max-width: 480px) {
          display: none;
        }
      }
      span {
        font-size: 22px;
        @media (max-width: 480px) {
          font-size: 20px;
        }
        &:last-of-type {
          b {
            color: $orange;
          }
        }
      }
    }

    &-buttons {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 40px;

      .go-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 210px;
        @media (max-width: 550px) {
          min-width: 50px;
          width: 50px;
          height: 50px;
          padding: 0;
          border-radius: 50px;
        }
        border-color: darken($color: $gray-line, $amount: 10);

        span {
          color: darken($color: $gray-line, $amount: 20);
          font-weight: 500;
          font-weight: 600;
          @media (max-width: 550px) {
            display: none;
          }
        }

        &:hover {
          background-color: darken($color: $gray-line, $amount: 90);
          border-color: darken($color: $gray-line, $amount: 90);

          span {
            color: $gray-line;
          }
        }

        svg {
          @media (max-width: 550px) {
            margin: 0;
            padding: 0;
          }
          margin-right: 12px;
          path {
            fill: transparent;
            stroke-width: 2;
          }
        }
      }

      .pay-btn {
        font-size: 16px;
        font-weight: 600;
        width: 210px;
        padding: 16px;
      }
    }
  }

  &--empty {
    margin: 0 auto;
    width: 560px;
    text-align: center;

    h2 {
      font-size: 32px;
      margin-bottom: 10px;
    }

    p {
      font-size: 18px;
      line-height: 145.4%;
      letter-spacing: 0.01em;
      color: #777777;
    }

    icon {
      position: relative;
      top: 2px;
    }

    img {
      display: block;
      width: 300px;
      margin: 45px auto 60px;
    }

    .button--black {
      padding: 12px 0 14px;
      width: 230px;
      margin: 0 auto;
      font-weight: 600;
      font-size: 18px;
    }
  }
}
